﻿<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">
	<ui:define name="body">
		<h:form prependId="false">
			<p:fieldset legend="#{messages['empresa.label']}" toggleable="false" toggleSpeed="500">
				<h:panelGrid id="fields" columns="3">
					<h:outputLabel value="#{messages['empresa.label.nome']}: " for="nome" styleClass="text-input" />
					<p:inputText id="nome" value="#{empresaEditMB.bean.nome}" tabindex="1"
						styleClass="longInput" title="#{messages['empresa.alt.nome']}" />
					<p:message for="nome" />
					<h:outputLabel value="#{messages['empresa.label.usuario']}: " for="usuario" styleClass="text-input" />
					<p:inputText id="usuario" value="#{empresaEditMB.bean.usuario}" maxlength="20" tabindex="2"
						styleClass="mediumInput" title="#{messages['empresa.alt.usuario']}" />
					<p:message for="usuario" />
				</h:panelGrid>
			</p:fieldset>
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['button.save']}" action="#{empresaEditMB.insert}"
						rendered="#{!empresaEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.save']}" action="#{empresaEditMB.update}"
						rendered="#{empresaEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['button.delete']}" onclick="confirmation.show()"
						rendered="#{empresaEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:confirmDialog message="#{messages['label.confirm.delete']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.delete']}" severity="alert" widgetVar="confirmation">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{empresaEditMB.delete}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
				<p:toolbarGroup align="right">
					<p:commandButton value="#{messages['button.cleanpass']}" onclick="dlg.show()"
						rendered="#{cantinaEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:confirmDialog message="#{messages['label.confirm.cleanpass']}" showEffect="bounce" hideEffect="explode"
						header="#{messages['label.dialog.cleanpass']}" severity="alert" widgetVar="dlg">
						<h:commandButton value="#{messages['button.dialog.yes']}" action="#{empresaEditMB.cleanPassword}" immediate="true"
							ajax="false" />
						<h:commandButton value="#{messages['button.dialog.no']}" onclick="dlg.hide()" type="button" />
					</p:confirmDialog>
				</p:toolbarGroup>
			</p:toolbar>
		</h:form>
	</ui:define>
</ui:composition>